package com.china08.yxyapi.api.manage.sch.platform.website.template;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.china08.yxyapi.api.YxyApiBaseController;
import com.china08.yxyapi.entity.db.sws.SwsTemplet;
import com.china08.yxyapi.repository.db.SwsSettingTempletRepository;

@CrossOrigin
@RestController
public class SwsTemplateCrtController extends YxyApiBaseController {

    @Autowired
    SwsSettingTempletRepository templateRepository;

    @RequestMapping(value = "/api_yw/manage/sch/platform/website/template/crt", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public Object precess(HttpServletRequest request, HttpServletResponse response) {

        SwsTemplet swsTemplet = new SwsTemplet();
        swsTemplet.setId("templ003");
        swsTemplet.setName("通用模板");
        swsTemplet.setType("1");
        swsTemplet.setTempletImage("/static/img/website/templ/templ3.png");
        swsTemplet.setSort("2");
        swsTemplet.setOrderNum(4);
        swsTemplet.setStatus(1);
        swsTemplet.setIsVip(0);
        templateRepository.save(swsTemplet);
        return null;
    }
}
